package com.welkom.everydate.domain;

import java.io.Serializable;
import com.welkom.everydate.util.web.Header;
public class Resource implements Serializable{
	@Header(headerText="资源编号")
	private long resourceId;
	
	@Header(headerText="资源名称")
	private String resourceName;
	
	@Header(headerText="资源类型")
	private int resourceType;
	
	@Header(headerText="优先级别")
	private int priority;
	
	@Header(headerText="访问路径")
	private String resourceString;
	
	private long parentResourceId;
	
	private String menuStyleClass;
	
	private String resourceMenuName;
	
	private String resourceDesc;
	
	@Header(headerText="资源状态")
	private int resourceEnabled;
	
	public Resource(long resourceId, String resourceName,
			int resourceType, int priority, String resourceString,long parentResourceId,String menuStyleClass,String resourceMenuName,
			String resourceDesc, int resourceEnabled, int issys) {
		this.resourceId = resourceId;
		this.resourceName = resourceName;
		this.resourceType = resourceType;
		this.priority = priority;
		this.resourceString = resourceString;
		this.resourceDesc = resourceDesc;
		this.resourceEnabled = resourceEnabled;
		this.parentResourceId=parentResourceId;
		this.menuStyleClass=menuStyleClass;
		this.resourceMenuName=resourceMenuName;
	}
	public Resource() {
		
	}
	/**
	 * @return the resourceId
	 */
	public long getResourceId() {
		return resourceId;
	}
	/**
	 * @param resourceId the resourceId to set
	 */
	public void setResourceId(long resourceId) {
		this.resourceId = resourceId;
	}
	/**
	 * @return the resourceName
	 */
	public String getResourceName() {
		return resourceName;
	}
	/**
	 * @param resourceName the resourceName to set
	 */
	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}
	/**
	 * @return the resourceType
	 */
	public int getResourceType() {
		return resourceType;
	}
	/**
	 * @param resourceType the resourceType to set
	 */
	public void setResourceType(int resourceType) {
		this.resourceType = resourceType;
	}
	/**
	 * @return the priority
	 */
	public int getPriority() {
		return priority;
	}
	/**
	 * @param priority the priority to set
	 */
	public void setPriority(int priority) {
		this.priority = priority;
	}
	/**
	 * @return the resourceString
	 */
	public String getResourceString() {
		return resourceString;
	}
	/**
	 * @param resourceString the resourceString to set
	 */
	public void setResourceString(String resourceString) {
		this.resourceString = resourceString;
	}
	/**
	 * @return the resourceDesc
	 */
	public String getResourceDesc() {
		return resourceDesc;
	}
	/**
	 * @param resourceDesc the resourceDesc to set
	 */
	public void setResourceDesc(String resourceDesc) {
		this.resourceDesc = resourceDesc;
	}
	/**
	 * @return the resourceEnabled
	 */
	public int getResourceEnabled() {
		return resourceEnabled;
	}
	/**
	 * @param resourceEnabled the resourceEnabled to set
	 */
	public void setResourceEnabled(int resourceEnabled) {
		this.resourceEnabled = resourceEnabled;
	}
	
	public long getParentResourceId() {
		return parentResourceId;
	}
	public void setParentResourceId(long parentResourceId) {
		this.parentResourceId = parentResourceId;
	}
	public String getMenuStyleClass() {
		return menuStyleClass;
	}
	public void setMenuStyleClass(String menuStyleClass) {
		this.menuStyleClass = menuStyleClass;
	}
	public String getResourceMenuName() {
		return resourceMenuName;
	}
	public void setResourceMenuName(String resourceMenuName) {
		this.resourceMenuName = resourceMenuName;
	}
	@Override
	public boolean equals(Object object){
		if(!(object instanceof Resource)){
			return false;
		}else{
			Resource resource=(Resource)object;
			if(!resource.getResourceName().equals(this.getResourceName())){
				return false;
			}
			if(!resource.getResourceString().equals(this.getResourceString())){
				return false;
			}
			if(!(resource.getResourceId()==this.getResourceId())){
				return false;
			}
		}
		return true;
	}
	
	@Override
	public int hashCode(){
		int result=17;
		result=31*result+(int)(resourceId^(resourceId>>>32));
		result=31*result+this.resourceName.hashCode();
		result=31*result+this.getResourceString().hashCode();
		return result;
	}
	
}
